#ifndef  _APP_MUSIC_CONTROLLER_H_
#define  _APP_MUSIC_CONTROLLER_H_

#include "cocos2d.h"
#include "SimpleAudioEngine.h"

USING_NS_CC;
using namespace CocosDenshion;

class MusicController {
public:

	MusicController();
	~MusicController();

	static MusicController * getInstance();

	//control music
	void preloadMusic(const char * path);
	void startMusic(const char *path, bool repeat);
	void resumeMusic();
	void pauseMusic();
	void stopMusic();
	void releaseMusic(const char *);
	//control effect
	void preloadEffect(const char * path);
	int startEffect(const char *path, bool repeat);
	void resumeEffect(int songId);
	void pauseEffect(int songId);
	void stopEffect(int songId);
	void releaseEffect(int songId);

	void setEffectOn(bool on);
	void setMusicOn(bool on);

	void init();
	void release();

private:

	bool m_bMusicOn;
	int m_musicState ;
	const char * m_musicPath;
	bool m_bEffectOn;

};

#endif // _APP_MUSIC_CONTROLLER_H_
